{	Problem: http://codechef.com/problems/NUMGAME2/
 	Verdict: Accepted
}
var i,n,k:longint;
begin
read(n);
i:=1;
while i<=n do begin
	read(k);
	if k mod 4=1 then writeln('ALICE') else writeln('BOB');
	inc(i);
end;
end. 